import request from "@/utils/request";

export function pageMenus(pageNum, pageSize, label) {
    return request({
        url: `/menu/page?pageNum=${pageNum}&pageSize=${pageSize}&label=${label}`,
        method: 'get',
    })
}


export function allMenus() {
    return request({
        url: `/menu/all`,
        method: 'get',
    })
}

export function addMenu(menu) {
    return request({
        url: `/menu`,
        method: 'post',
        data: menu
    })
}
export function updateMenu(menu) {
    return request({
        url: `/menu`,
        method: 'put',
        data: menu
    })
}
export function deleteMenu(id) {
    return request({
        url: `/menu/${id}`,
        method: 'delete',
    })
}
